/**
 * Created with IntelliJ IEDA.
 * Description:
 * User:86186
 * Date:2022-10-11
 * Time:10:58
 */
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/**
 * 删除公共字符
 */

public class Main4 {
    // 注意类名必须为 Main, 不要有任何 package xxx 信息
        public static void main(String[] args) {

            Scanner in = new Scanner(System.in);
            String s1 = in.nextLine();
            String s2 = in.nextLine();
            deletetheSame(s1,s2);
        }

    private static void deletetheSame(String s1, String s2) {
        StringBuffer stringBuffer = new StringBuffer();
        Set<Character> set = new HashSet<>();
        for (char c : s2.toCharArray()) {
            set.add(c);
        }
        for (int i = 0; i < s1.length(); i++) {
            if (!set.contains(s1.charAt(i))){
                stringBuffer.append(s1.charAt(i));
            }
        }
        System.out.println(stringBuffer.toString());
    }
}
